package com.csjbot.blackgaga.feature.navigation;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.Toast;

import com.csjbot.blackgaga.R;
import com.csjbot.blackgaga.base.BaseFullScreenActivity;
import com.csjbot.blackgaga.base.BasePresenter;
import com.csjbot.blackgaga.feature.navigation.contract.NaviCommentContract;
import com.csjbot.blackgaga.feature.navigation.contract.NaviCommentPresenter;

import butterknife.OnClick;

/**
 * Created by xiasuhuei321 on 2017/12/12.
 * author:luo
 * e-mail:xiasuhuei321@163.com
 */

public class NaviGuideCommentActivity extends BaseFullScreenActivity implements NaviCommentContract.View {
    NaviCommentContract.Presenter presenter = new NaviCommentPresenter();

    @Override
    protected BasePresenter getPresenter() {
        return presenter;
    }

    @Override
    public int getLayoutId() {
        return R.layout.activity_service_evaluation;
    }

    @Override
    public void afterViewCreated(Bundle savedInstanceState) {
        h.postDelayed(this::finish, 60000);
    }

    @OnClick(R.id.buttonPanel1)
    public void wellClick(){
        well();
    }

    @OnClick(R.id.buttonPanel2)
    public void veryWellClick(){
        veryWell();
    }

    @OnClick(R.id.buttonPanel1)
    public void badClick(){
        bad();
    }

    @Override
    public void well() {
        Toast.makeText(context, "满意", Toast.LENGTH_SHORT).show();
        NaviAction.getInstance().back();
        this.finish();
    }

    @Override
    public void veryWell() {
        Toast.makeText(context, "非常满意", Toast.LENGTH_SHORT).show();
        NaviAction.getInstance().back();
        this.finish();
    }

    @Override
    public void bad() {
        Toast.makeText(context, "不满意", Toast.LENGTH_SHORT).show();
        NaviAction.getInstance().back();
        this.finish();
    }

    Handler h = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
        }
    };

    @Override
    protected void onDestroy() {
        super.onDestroy();
        h.removeCallbacksAndMessages(null);
    }

}
